This page last changed on Oct 24, 2006 by cholmes.


GeoServer follows the Sun's coding standards. Developers need not all develop exactly to the standard, as we make use of Jalopy, a source code formatter. It lays out any valid Java source code according to configurable rules to meet a coding style without putting a formatting burden on individual developers. It is required to set up Jalopy, which is easily integrated with most IDE's (and available on the command line). The coding convention for GeoServer is contained in the 'documents' folder: jalopy.geoserver.xml. It will put on the correct header for you, in addition to formatting all the code. If there are parts of the code that you do not want formatted with Jalopy then you can insert //J++ and //J-- before and after the blocks of code that should not be jalopied.

One thing Jalopy does not do for you is get rid of .* imports. Code is much more clear if there are no mass imports, in the GeoServer code base we like every class used in the file to be explicitly named. This is easily done with most modern compilers, such as eclipse (organize imports). Please make use of it.

Also note that every method should have a javadoc comment. Please do not leave any undocumented, as some other developer will have to clean up your omissions, and that's a great way to make developers hate life. Most people do not like documentation, especially not when it is someone else's code. Each class should also have a good comment explaining what it does, along with @version and @author tags. For the version tag we recommend letting subversion control it, if creating a new class then just put

$Id: hacking.xml 2976 2004-10-13 23:25:25Z cholmes $

for the version, and it will be formatted when first committed.

Document generated by Confluence on Jan 16, 2008 23:26